package com.hxw.dubbo;

import com.alibaba.dubbo.config.spring.context.annotation.EnableDubboConfig;
import com.hxw.dubbo.demo.HelloConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableDubboConfig
@SpringBootApplication
public class ConsumerDubboApplication {

    @Autowired
    HelloConsumer helloConsumer;

	public static void main(String[] args) {
		SpringApplication.run(ConsumerDubboApplication.class, args);
	}

	@GetMapping(value = "/hello")
	public String getHello(String name){
	    return helloConsumer.getHello(name);
    }
}
